<template>
  <div class="top"> 
    <div class="left">
        <div class="left_left">
            <img src="https://test.nttcc.com.cn/_nuxt/img/logo_1.e54ae31.png" alt="" class="left_leftbox_img">
            <div class="left_leftbox_text">共创云</div>
        </div>
        <div class="left_right">
            <div 
            v-for="(item,index) in ref2.leftRight" 
            :key="index" class="left_right_text" 
            :class="index>0?'left_right_next':''" 
            @click="ref3(ref1)">{{ item }}</div>
        </div>
    </div>
    <div class="right">
        <div class="login">登入</div>
        <div class="enroll">注册</div>
    </div>
  </div>
</template>

<script>
import { ref } from 'vue';  // 一定要线引入ref
export default{
    setup(){
        const ref1 = ref('abc') // 再页面中可以直接使用ref1,但是再js中要使用ref1.value
        const ref2 = ref({a:123,leftRight:['产品服务','科创需求','专利论文','交易大数据']}) //同样在js中要使用ref2.value
        const ref3 = (data)=>{ // 函数可以直接定义，不用加ref（）
            console.log(data)
        }
        return {
            ref1,
            ref2,
            ref3
        }
    }
}
</script>

<style scoped>
.top{
    width: 1200px;
    height: 50px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.left{
    width: 448px;
    height: 30px;
    display: flex;
}
.right{
    width: 138px;
    height: 32px;
}
.left_left{
    width: 88px;
    height: 30px;
    display: flex;
    align-items: center;
    margin-right: 50px;
}
.left_leftbox_img{
    width: 30px;
    height: 30px;
    margin-right: 10px;
}
.left_leftbox_text{
    font-size: 16px;
    font-weight: 700;
    line-height: 22px;
    color: #3473e6;
}
.left_right{
    display: flex;
}
.left_right_text{
    font-size: 14px;
    line-height: 30px;
    color: #606266;
}
.left_right_text:hover{
    color: #3473e6;
}
.left_right_next{
    margin-left: 24px;
}
.right{
    width: 138px;
    height: 32px;
    display: flex;
}
.login{
    width: 64px;
    height: 32px;
    background: #3473e6;
    border-radius: 4px;
    margin-right: 10px;
    color: #fff;
    line-height: 32px;
    text-align: center;
}
.enroll{
    width: 64px;
    height: 32px;
    background: #fff;
    border: 1px solid #90b7f1;
    border-radius: 4px;
    color: #3473e6;
    line-height: 32px;
    text-align: center;
}
</style>